home *** CD-ROM | disk | FTP | other *** search
- /* AnalyzerSpec.c */
- /*****************************************************************************/
- /* */
- /* Out Of Phase: Digital Music Synthesis on General Purpose Computers */
- /* Copyright (C) 1994 Thomas R. Lawrence */
- /* */
- /* This program is free software; you can redistribute it and/or modify */
- /* it under the terms of the GNU General Public License as published by */
- /* the Free Software Foundation; either version 2 of the License, or */
- /* (at your option) any later version. */
- /* */
- /* This program is distributed in the hope that it will be useful, */
- /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
- /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
- /* GNU General Public License for more details. */
- /* */
- /* You should have received a copy of the GNU General Public License */
- /* along with this program; if not, write to the Free Software */
- /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- /* */
- /* Thomas R. Lawrence can be reached at tomlaw@world.std.com. */
- /* */
- /*****************************************************************************/
-
- #include "MiscInfo.h"
- #include "Audit.h"
- #include "Debug.h"
- #include "Definitions.h"
-
- #include "AnalyzerSpec.h"
- #include "Memory.h"
- #include "DataMunging.h"
-
-
- struct AnalyzerSpecRec
- {
- char* String;
- };
-
-
- /* create a new analyzer spec */
- AnalyzerSpecRec* NewAnalyzerSpec(char* Identifier)
- {
- AnalyzerSpecRec* Analyzer;
-
- CheckPtrExistence(Identifier);
- Analyzer = (AnalyzerSpecRec*)AllocPtrCanFail(sizeof(AnalyzerSpecRec),
- "AnalyzerSpecRec");
- if (Analyzer == NIL)
- {
- FailurePoint1:
- return NIL;
- }
- Analyzer->String = CopyPtr(Identifier);
- if (Analyzer->String == NIL)
- {
- FailurePoint2:
- ReleasePtr((char*)Analyzer);
- goto FailurePoint1;
- }
- SetTag(Analyzer->String,"AnalyzerSpecRec.String");
- return Analyzer;
- }
-
-
- /* dispose analyzer spec */
- void DisposeAnalyzerSpec(AnalyzerSpecRec* Analyzer)
- {
- CheckPtrExistence(Analyzer);
- ReleasePtr((char*)Analyzer->String);
- ReleasePtr((char*)Analyzer);
- }
-
-
- /* get actual heap block analyzer identifier string */
- char* GetAnalyzerSpecString(AnalyzerSpecRec* Analyzer)
- {
- CheckPtrExistence(Analyzer);
- return Analyzer->String;
- }
-